package d3_thread_api;

import d1_create_thread.MyThread;

/**
 * 2024/6/23 掌握sleep方法,join方法的作用
 */
public class ThreadTest {
    public static void main(String[] args) throws InterruptedException {
        for (int i = 1; i <=5 ; i++) {
            if(i==3){
                //会让当前执行的线程暂停5秒,再继续执行
                Thread.sleep(3000);
            }
        }

        MyThread t1 = new MyThread("1号线程");
        t1.start();
        t1.join();
    }
}
